<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>背景颜色以及图像</title>
  <style>
    body {margin: 0;padding: 0;}
    /* 所有 div 元素受到影响. */
    div {
      background-image: linear-gradient(60deg, rgba(99, 224, 126, 0.5),rgba(118, 150, 236, 0.5)),url(./favicon.ico);
      margin-top: 20px;
      margin-left: 100px;
      width: 80%;
      height: 135px;
      color: black;
    }
    .demo1 {
      background-repeat: repeat-x;
    }
    .demo2 {
      background-repeat: no-repeat;
      background-origin: border-box;
      border: 5px solid rgb(79, 122, 241);
      padding: 10px;
    }
    .demo3 {
      background-position: center left;
      background-origin: padding-box;
      border: 10px double;
      padding: 10px;
    }
    .demo4 {
      background-origin: content-box;
      background-position: top right, 0px 0px;
      border: 5px rgb(83, 248, 124) dotted;
      padding: 10px;
    }
    .demo5 {
      background-image: url(./favicon.ico);
      background-size: 75px;
      width: 300px;
      height: 300px;
      border: 2px solid;
      color: rgb(0, 0, 0);
     }
  </style>
</head>
<body>
  <div class="demo1"> 
    <p>元素背景demo1, 渐变从左到右，背景图像可横向重复</p>
  </div>
  <div class="demo2"> 
    <p>元素背景demo2,背景不重复显示，背景图片的摆放以 border 区域为参考</p>
  </div>
  <div class="demo3"> 
    <p>元素背景demo3,背景可重复显示，背景图片的摆放以 padding 区域为参考</p>
  </div>
  <div class="demo4"> 
    <p>元素背景demo4,背景可重复显示，背景图片的摆放两边以 content 、padding区域为参考</p>
  </div>
  <div class="demo5"> 
    <p>background-size:设置背景图片大小</p>
  </div>
</body>
</html>